package com.dlwx.parttimetalent.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by Administrator on 2017/11/28.
 */

public class ApiTokenBean implements Parcelable {

    public ApiTokenBean() {
    }

    /**
     * code : 200
     * result : 获取成功
     * body : {"clientid":7,"apitoken":"b5a01c90ff6f90be079c7b9938cf8464"}
     */

    private int code;
    private String result;
    private BodyBean body;

    protected ApiTokenBean(Parcel in) {
        code = in.readInt();
        result = in.readString();
    }

    public static final Creator<ApiTokenBean> CREATOR = new Creator<ApiTokenBean>() {
        @Override
        public ApiTokenBean createFromParcel(Parcel in) {
            return new ApiTokenBean(in);
        }

        @Override
        public ApiTokenBean[] newArray(int size) {
            return new ApiTokenBean[size];
        }
    };

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    public BodyBean getBody() {
        return body;
    }

    public void setBody(BodyBean body) {
        this.body = body;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(code);
        dest.writeString(result);
    }

    public static class BodyBean implements Parcelable {
        public BodyBean() {
        }

        /**
         * clientid : 7
         * apitoken : b5a01c90ff6f90be079c7b9938cf8464
         */

        private int clientid;
        private String apitoken;

        protected BodyBean(Parcel in) {
            clientid = in.readInt();
            apitoken = in.readString();
        }

        public static final Creator<BodyBean> CREATOR = new Creator<BodyBean>() {
            @Override
            public BodyBean createFromParcel(Parcel in) {
                return new BodyBean(in);
            }

            @Override
            public BodyBean[] newArray(int size) {
                return new BodyBean[size];
            }
        };

        public int getClientid() {
            return clientid;
        }

        public void setClientid(int clientid) {
            this.clientid = clientid;
        }

        public String getApitoken() {
            return apitoken;
        }

        public void setApitoken(String apitoken) {
            this.apitoken = apitoken;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(clientid);
            dest.writeString(apitoken);
        }
    }
}
